package com.ruoyi.prize.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.prize.mapper.PointsLotteryPrizeMapper;
import com.ruoyi.prize.domain.PointsLotteryPrize;
import com.ruoyi.prize.service.IPointsLotteryPrizeService;

/**
 * 积分抽奖奖品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-01
 */
@Service
public class PointsLotteryPrizeServiceImpl implements IPointsLotteryPrizeService 
{
    @Autowired
    private PointsLotteryPrizeMapper pointsLotteryPrizeMapper;

    /**
     * 查询积分抽奖奖品
     * 
     * @param id 积分抽奖奖品主键
     * @return 积分抽奖奖品
     */
    @Override
    public PointsLotteryPrize selectPointsLotteryPrizeById(Long id)
    {
        return pointsLotteryPrizeMapper.selectPointsLotteryPrizeById(id);
    }

    /**
     * 查询积分抽奖奖品列表
     * 
     * @param pointsLotteryPrize 积分抽奖奖品
     * @return 积分抽奖奖品
     */
    @Override
    public List<PointsLotteryPrize> selectPointsLotteryPrizeList(PointsLotteryPrize pointsLotteryPrize)
    {
        return pointsLotteryPrizeMapper.selectPointsLotteryPrizeList(pointsLotteryPrize);
    }

    /**
     * 新增积分抽奖奖品
     * 
     * @param pointsLotteryPrize 积分抽奖奖品
     * @return 结果
     */
    @Override
    public int insertPointsLotteryPrize(PointsLotteryPrize pointsLotteryPrize)
    {
        pointsLotteryPrize.setCreateTime(DateUtils.getNowDate());
        return pointsLotteryPrizeMapper.insertPointsLotteryPrize(pointsLotteryPrize);
    }

    /**
     * 修改积分抽奖奖品
     * 
     * @param pointsLotteryPrize 积分抽奖奖品
     * @return 结果
     */
    @Override
    public int updatePointsLotteryPrize(PointsLotteryPrize pointsLotteryPrize)
    {
        pointsLotteryPrize.setUpdateTime(DateUtils.getNowDate());
        return pointsLotteryPrizeMapper.updatePointsLotteryPrize(pointsLotteryPrize);
    }

    /**
     * 批量删除积分抽奖奖品
     * 
     * @param ids 需要删除的积分抽奖奖品主键
     * @return 结果
     */
    @Override
    public int deletePointsLotteryPrizeByIds(Long[] ids)
    {
        return pointsLotteryPrizeMapper.deletePointsLotteryPrizeByIds(ids);
    }

    /**
     * 删除积分抽奖奖品信息
     * 
     * @param id 积分抽奖奖品主键
     * @return 结果
     */
    @Override
    public int deletePointsLotteryPrizeById(Long id)
    {
        return pointsLotteryPrizeMapper.deletePointsLotteryPrizeById(id);
    }
}
